package com.example.security.config;

import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.GrantedAuthority;

import java.util.Collection;

public class CustomizedToken extends UsernamePasswordAuthenticationToken {

    private String userType;
    private Object userInfo;


    public CustomizedToken(Object principal, Object credentials,String userType) {
        super(principal, credentials);
        this.userInfo=userType;
    }
    public CustomizedToken(Object principal, Object credentials,String userType,Object userInfo) {
        super(principal, credentials);
        this.userInfo=userType;
        this.userInfo=userInfo;
    }

    public CustomizedToken(Object principal, Object credentials, Collection<? extends GrantedAuthority> authorities,String userType) {
        super(principal, credentials, authorities);
        this.userInfo=userType;
    }
    public CustomizedToken(Object principal, Object credentials, Collection<? extends GrantedAuthority> authorities,String userType,Object userInfo) {
        super(principal, credentials, authorities);
        this.userInfo=userType;
        this.userInfo=userInfo;
    }


    public CustomizedToken(Object principal, Object credentials) {
        super(principal, credentials);
    }

    public CustomizedToken(Object principal, Object credentials, Collection<? extends GrantedAuthority> authorities) {
        super(principal, credentials, authorities);
    }

    public String getUserType() {
        return userType;
    }

    public void setUserType(String userType) {
        this.userType = userType;
    }

    public Object getUserInfo() {
        return userInfo;
    }

    public void setUserInfo(Object userInfo) {
        this.userInfo = userInfo;
    }
}
